]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/icon: Fix GIcon leak in set_icon_name
authorSebastian Keller <skeller@gnome.org>
Wed, 22 Jan 2020 18:12:49 +0000 (19:12 +0100)
committerSebastian Keller <skeller@gnome.org>
Wed, 22 Jan 2020 19:20:50 +0000 (20:20 +0100)
set_icon_name() leaks a GIcon by using the set_icon method which adds a
ref to the GIcon without removing its own ref after calling the method.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/2146

src/st/st-icon.c

index aa98ed2236a16abf6cff605f4811ec5033ffe71f..70e4fb46cfba0c29b71d65f3abcdf0af419ffd18 100644 (file)
@@ -549,7 +549,7 @@ void
 st_icon_set_icon_name (StIcon      *icon,
                        const gchar *icon_name)
 {
-  GIcon *gicon = NULL;
+  g_autoptr(GIcon) gicon = NULL;
 
   g_return_if_fail (ST_IS_ICON (icon));